<?php
/**
 * Base class for all services.
 * Services should contain business logic of the application.
 * The logic can be shared by several controllers.
 * @author jan
 */
abstract class ServiceBase {
	
	/** @var YoseminDao */
	protected $dao;
	private $languageCode;
	protected $authUser;
	/** @var Messages */
	protected $msg;
	/** @var SessionData */
	protected $sessionData;
	
	public function __construct() {
		$this->dao = YoseminDao::instance();
		$this->msg = Messages::instance();
		$this->languageCode = Router::$language;
		$this->sessionData = SessionData::instance();
		$this->authUser = $this->sessionData->getAuthUser();
	}
	
	protected function getL10nLanguageCode() {
		return $this->languageCode;
	}
}
